<template>
    <div>
        <div class="mui-numbox" data-numbox-step='1' data-numbox-min='1' :data-numbox-max='maxNum'>
            <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
            <input class="mui-numbox-input" type="number" ref='input' @change="changeNum"/>
            <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
        </div>
    </div>
</template>
<script>
    import mui from '../lib/mui/js/mui.min.js';
    export default {
        mounted(){
            mui('.mui-numbox').numbox()
        },
        data(){
            return {

            }
        },
        methods:{
            changeNum(){
                this.$emit('changenum',this.$refs.input.value)
            }
        },
        mounted(){
            console.log('111111111----------'+this.maxNum);
        },
        props:['maxNum'],
        watch:{
            maxNum(n,o){
                mui('.mui-numbox').numbox().setOption('max',n)
            }
        }
    }
</script>